home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / hsrc_117.zip / FINDAREA.C < prev    next >
Text File  |  1990-11-12  |  1KB  |  50 lines

  1. #include "msgg.h"
  2. #include "twindow.h"
  3. #include "keys.h"
  4. #include "headedit.h"
  5.  
  6. int pascal find_area (void) {
  7.  
  8.     word register x;
  9.  
  10.     if (areano==0) return 0;
  11.     if (!maxareas) goto NullArea;
  12.  
  13.     for (x=0;x<maxareas;x++) {
  14.         if (marea[x].number==areano) {
  15.             currarea=(struct _marea far *)&marea[x];
  16.             if(!marea[x].thisname) {
  17.                 if(!notrack) {
  18.                     if(noalias>1) {
  19.                         if(marea[x].attr & REAL) strcpy(name,alias[0]);
  20.                         else strcpy(name,alias[1]);
  21.                     }
  22.                 }
  23.             }
  24.             else {
  25.                 strcpy(name,alias[(marea[x].thisname-1)]);
  26.             }
  27.             if(marea[x].thisaddr) {
  28.                 curaddress.zone=address[(marea[x].thisaddr)-1]->zone;
  29.                 curaddress.net=address[(marea[x].thisaddr)-1]->net;
  30.                 curaddress.node=address[(marea[x].thisaddr)-1]->node;
  31.                 curaddress.point=address[(marea[x].thisaddr)-1]->point;
  32.                 strcpy(curaddress.domain,address[(marea[x].thisaddr)-1]->domain);
  33.             }
  34.             return 1;
  35.         }
  36.         else if (marea[x].number>higharea) goto NullArea;
  37.     }
  38.  
  39. NullArea:
  40.  
  41.     nullarea.attr=12;
  42.     currarea=&nullarea;
  43.     nullarea.number=areano;
  44.     if(!notrack) {
  45.         if(noalias>1)strcpy(name,alias[1]);
  46.         else strcpy(name,alias[0]);
  47.     }
  48.     return 0;
  49. }
  50.